package com.example.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Ignin;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tyhxzy
 * @since 2023-11-03
 */
public interface IgninMapper extends BaseMapper<Ignin> {
    @SelectKey(statement = "select last_insert_id()" ,keyColumn = "id",keyProperty = "id",before = false,resultType = Integer.class)
    @Insert("insert into signin(phone,deleted) values (#{phone},0)")
    int addPhone(Ignin ignin);
    @Update("UPDATE signin SET deleted=#{del} WHERE id=#{id}")
    int update(@Param("id") Integer id,@Param("del") Integer del);
    @Select("SELECT \n" +
            "deleted\n" +
            "FROM signin\n" +
            "WHERE id=#{id}")
    int findByDeletedInt(Integer id);

}
